package bis;

import java.io.Serializable;
import java.text.ParseException;
import java.util.ArrayList;
import obj.*;

public class FLBook extends FLBase implements Serializable {

    String id = null, Bm, mc, author, publisher, pubDate, isbn, lxbm, ym, picPath, content;
    int price;

    public void setDelete(String bm) {
        CommonVar.flbookmgr.setdelete(bm);

    }

    public ArrayList getDate() {
        return CommonVar.flbookmgr.GetAllDate();
    }

    public ArrayList getDateByid() {
        return CommonVar.flbookmgr.GetDateById(id);
    }

    public ArrayList getDateByFindOption(String key, String id) {
        return CommonVar.flbookmgr.getDateByFindOption(key, id);

    }

    public ArrayList getDateByclass() {
        if (id == null) {
            return this.getDate();
        } else {
            return CommonVar.flbookmgr.GetDateByclass(id);
        }
    }

    public boolean isInsert() {
        return CommonVar.flbookmgr.Insert(this);
    }

    public void setUpdate(FLBook flbc) {
        CommonVar.flbookmgr.setUpdate(flbc);
    }

    public boolean isUpdate() {
        CommonVar.flbookmgr.setUpdate(this);
        return true;

    }

    public String getBm() {
        return Bm;
    }

    public void setBm(String Bm) {
        this.Bm = Bm;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getIsbn() {
        return isbn;
    }

    public void setIsbn(String isbn) {
        this.isbn = isbn;
    }

    public String getLxbm() {
        return lxbm;
    }

    public void setLxbm(String lxbm) {
        this.lxbm = lxbm;
    }

    public String getMc() {
        return mc;
    }

    public void setMc(String mc) {
        this.mc = mc;
    }

    public String getPicPath() {
        return picPath;
    }

    public void setPicPath(String picPath) {
        this.picPath = picPath;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getPubDate() {
        return pubDate;
    }

    public void setPubDate(String pubDate) {
        this.pubDate = pubDate;
    }

    public String getPublisher() {
        return publisher;
    }

    public void setPublisher(String publisher) {
        this.publisher = publisher;
    }

    public String getYm() {
        return ym;
    }

    public void setYm(String ym) {
        this.ym = ym;
    }

    public FLBook(String id,String Bm, String mc, String author, String publisher, String pubDate, String isbn, int price, String lxbm, String ym, String picPath, String content) {
        this.Bm = Bm;
        this.mc = mc;
        this.author = author;
        this.publisher = publisher;
        this.pubDate = pubDate;
        this.isbn = isbn;
        this.lxbm = lxbm;
        this.ym = ym;
        this.picPath = picPath;
        this.content = content;
        this.price = price;
    }

    public FLBook() {
    }


    public static void main(String[] args) throws ParseException {
FLBook b=new FLBook("1","1","delphi","李维","borland","20000000","8888",999,"1","1000","8.pic","好书");
b.isInsert();
b=new FLBook("1","3","delphi","李维","borland","20000000","8888",999,"1","1000","8.pic","好书");
b.isInsert();
b=new FLBook("1","7","delphi","李维","borland","20000000","8888",999,"1","1000","8.pic","好书");
b.isInsert();
    }
}

